#ifndef REGULARSHAPE_H
#define REGULARSHAPE_H

//template<uchar _sides = 3>
class RegularShape : public RigidBody, public ConvexShape, public IPolygon
{
private:
	uchar _sides;
	scalar _size;
	std::vector<vector3> _vertices;
protected:
	virtual vector3 doGetSupport(const vector3&) const;
public:
	RegularShape(uchar sides, scalar size = 1, scalar mass = 0, scalar elasticity = 1);
	RegularShape(uchar sides, const vector3 &pos, const vector3 &vel, scalar size = 1, scalar mass = 0, scalar elasticity = 1);
	RegularShape(const RegularShape &);

	virtual void integrate(scalar time);

    using RigidBody::position;

	virtual const std::vector<vector3>& vertices() const;
	virtual void position(scalar x, scalar y, scalar z = 0);

	scalar size() const;
	void size(scalar s);

	uchar sides() const;
	void sides(uchar s);
};

/*
 class RegularShape::Triangle : private RegularShape
 {
 public:
 Triangle(scalar size = 1, scalar mass = 0, scalar elasticity = 1);
 Triangle(const vector3 &pos, const vector3 &vel, scalar size = 1, scalar mass = 0, scalar elasticity = 1);
 Triangle(const Triangle &);

 using RegularShape::integrate;
 using RegularShape::vertices;
 using RegularShape::size;
 };

 class RegularShape::Square : private RegularShape
 {
 public:
 Square(scalar size = 1, scalar mass = 0, scalar elasticity = 1);
 Square(const vector3 &pos, const vector3 &vel, scalar size = 1, scalar mass = 0, scalar elasticity = 1);
 Square(const Square &);

 using RegularShape::integrate;
 using RegularShape::vertices;
 using RegularShape::size;
 };

 class RegularShape::Pentagon : private RegularShape
 {
 public:
 Pentagon(scalar size = 1, scalar mass = 0, scalar elasticity = 1);
 Pentagon(const vector3 &pos, const vector3 &vel, scalar size = 1, scalar mass = 0, scalar elasticity = 1);
 Pentagon(const Pentagon &);

 using RegularShape::integrate;
 using RegularShape::vertices;
 using RegularShape::size;
 };
 */

#endif // REGULARSHAPE_H
